<template>
	<view class="content">
		
		<view class="status_bar">
			<!-- 这里是状态栏 -->
		</view>  
		 
		<!-- 自定义状态栏 -->
		<view class="status_title">
			<u-icon name="search" class="status_left" size="25" color="#fff" @click="sosuo"></u-icon>
			<view class="status_center">首页</view>
			<view class="status_right"></view>
		</view>
		<!-- 轮播图 -->
		<view>
			 <u-swiper
				:list="list3"
				indicator
				indicatorMode="line"
				circular
			></u-swiper>
		</view>
		<!-- 附近商家 -->
		<view class="fujing">
			<view class="fujing-u-icon">
				<u-icon name="list" size="20"></u-icon>
			</view>
			<view class="fujing-text">附近商家</view> 
		</view>
		<!-- 数据列表 -->
		<view class="dataList-data">
			<view class="dataList-data-view" v-for="(item,index) in shuju" :key="index" @click="goinfo(item.id)">
				<view class="dataList-img">
					<img :src="item.logo" alt="" /> 
				</view>
				<view class="dataList-text">
					<p><span>品牌</span>{{item.shopname}}</p>
					<view class="dazhe">
						{{item.content}} 
						<p>￥{{item.fee}}起送 / 配送费约￥{{item.fee}}</p>
					</view>
					
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list3: [
					'https://cdn.uviewui.com/uview/swiper/swiper3.png',
					'https://cdn.uviewui.com/uview/swiper/swiper2.png',
					'https://cdn.uviewui.com/uview/swiper/swiper1.png',
				],
				shuju:[]
			}
		},
		onShow() {
			uni.request({
<<<<<<< HEAD
			  url: 'http://10.31.67.9:8002/admin/shoplists',
=======
			  url: 'http://192.168.137.23:8002/admin/shoplists',
>>>>>>> bed7c74310735032c04491253875d412658520be
			  method: 'GET',
			  success: (res)=>{
				this.shuju=res.data
			  },
			  fail(error) {
			  	console.log(error);
			  }
			});
		},
		methods: {
			sosuo(){
				uni.switchTab({
					url:'/pages/search/search'
				});
			},
			goinfo(e){
				uni.navigateTo({
					url:`/pages/productDetails/productDetails?id=`+e
				});
				console.log(e,'1231233');
			}
		}
	}
</script>

<style lang="scss" scoped>
	
	/* 自定义状态栏 */
	.status_bar {
	  height: var(--status-bar-height);
	  width: 100%;
	  background: #02a774;
	}
	 
	/* 自定义导航栏 */
	.status_title {
		box-sizing: border-box;
		display: flex;
		justify-content: space-between;
		align-items: center;
		width: 100%;
		height: 35px;
		padding: 0 16px;
		background-color: #02a774;
	}
	.status_left {
		width: 18px !important;
		height: 35px;
		background: pink;
		background-color: #02a774;
	}
	.status_center {
		font-size: 17px;
		font-weight: 700;
		color: #fff;
	}
	.status_right {
		width: 22px;
		height: 35px;
		// background: #000;
	}
	// 轮播图
	// 附近商家
	.fujing{
		margin-top: 20rpx;
		margin-bottom: 20rpx;
		.fujing-u-icon{
			// margin-top: 10rpx;
			float: left;
			margin: 0 10rpx;
			.u-icon{
				margin-top: 5rpx;
			}
		}
	}
	// 数据列表
	.dataList-data{
		.dataList-data-view{
			padding: 10rpx;
			// width: 100%;
			height: 150rpx;
			// background: pink;
			margin-bottom: 20rpx;
			.dataList-img{
				float: left;
				width: 150rpx;
				height: 150rpx;
				img{
					width: 100%;
					height: 100%;
				}
			}
			.dataList-text{
				float: left;
				p{
					font-weight: 700;
					span{
						font-weight: 300;
						font-size: 25rpx;
						background: #ffd930;
						border-radius: 5rpx;
						padding: 0 15rpx;
						margin: 0 10rpx;
					}
				}
				.dazhe{
					margin-top: 20rpx;
					margin-left: 20rpx;
					font-size: 30rpx;
					p{
						margin-top: 15rpx;
						font-size: 20rpx;
						color: #707070;
					}
				}
			}
		}		
	}
</style>